﻿layui.define(['jquery', 'form'], function (exports) {
    var $ = layui.jquery;
    var form = layui.form;
    var analysis = {
        exeAnalysis: function (tle, plotOptions, series, xAxis, yAxis ) {
            layer.open({
                type: 2,
                title: '障害统计图',
                maxmin: false,
                area: ['800px', '600px'],
                content: '/Project/Analysis',
                success: function (layero, index) {
                    var chart = {
                        plotShadow: true
                    };
                    var credits = {
                        enabled: false 
                    }
                    var title = {
                        text: tle
                    };
                    var json = {};
                    json.chart = chart;
                    json.title = title;
                    json.series = series;
                    json.plotOptions = plotOptions;
                    json.credits = credits;
                    if (xAxis != undefined) {
                        json.xAxis = xAxis;
                    }
                    if (yAxis != undefined) {
                        json.yAxis = yAxis;  
                    }
                    var iframe = window['layui-layer-iframe' + index];
                    iframe.setCharts(json);
                }
            });
        }
    };
    exports('analysis', analysis);
});